import * as echarts from 'echarts';
function getVirtualData(year) {
    const date = +echarts.time.parse(year + '-01-01');
    const end = +echarts.time.parse(year + '-12-31');
    const dayTime = 3600 * 24 * 1000;
    const data = [];
    for (let time = date; time <= end; time += dayTime) {
        data.push([
            echarts.time.format(time, '{yyyy}-{MM}-{dd}', false),
            Math.floor(Math.random() * 10000)
        ]);
    }
    return data;
}
let Template = [
    {
        id: 'Heatmap_0001',
        component: 'Heatmap01', // 基础日历图
        style: {
            width: {
                value: 1200,
                pixel: 1200,
                unit: 'px'
            },
            height: {
                value: 350,
                pixel: 350,
                unit: 'px'
            },
            top: {
                value: 0,
                pixel: 0,
                unit: 'px'
            },
            left: {
                value: 0,
                pixel: 0,
                unit: 'px'
            },
            bottom: {
                value: '',
                unit: 'px'
            },
            right: {
                value: '',
                unit: 'px'
            },
            backgroundImage: {
                angle: 90,
                color: []
            },
            borderRadius: {
                value: 0,
                unit: 'px'
            },
            borderWidth: 0,
            borderStyle: 'solid',
            borderColor: '#FFFFFF',
            boxShadow: {
                level: 0,
                vertical: 0,
                blur: 0,
                spread: 0,
                color: '#000000FF'
            },
            rotate: 0,
            opacity: 100,
            'z-index': '1',
            backdropFilter: 0,
            filter: 0
        },
        attribute: {
            visible: true,
            chartOption: {
                type: 'heatmap',
                option: {
                    visualMap: {
                        show: false,
                        min: 0,
                        max: 10000
                    },
                    calendar: {
                        range: '2023'
                    },
                    series: {
                        type: 'heatmap',
                        coordinateSystem: 'calendar',
                        data: getVirtualData('2023')
                    }
                }
            }, // echarts统计图模板 object
            interval: -1, // 定时器间隔（毫秒） number
            page: 0,
            highlight: false,
            locked: false
        },
        animate: [],
        event: [],
        data: {
            url: '',
            key: [],
            type: 'static',
            datatype: 'json',
            method: '0',
            field: [],
            value: [] // 二维数组 存静态数据 二维数组
        }
    }
]

export default Template;